import { pubRequire } from '@utils/public'
const baseUrl = '/content/labels/categories'
// 获取配置标签分类列表
export function getConTagsList(obj, callBack, errBack) {
  return pubRequire('get', `${baseUrl}`, obj, callBack, errBack)
}
//条件查询标签分类
export function getClasses(obj, callBack, errBack) {
  return pubRequire('get', `${baseUrl}/options`, obj, callBack, errBack)
}
//编辑查询配置标签
export function getEditLable(categorieId, callBack, errBack) {
  return pubRequire('get', `${baseUrl}/${categorieId}`, '', callBack, errBack)
}
//新增配置标签
export function postAddLable(obj, callBack, errBack) {
  return pubRequire('post', `${baseUrl}`, obj, callBack, errBack)
}
//编辑配置标签
export function putEditLable(categorieId, obj, callBack, errBack) {
  return pubRequire('put', `${baseUrl}/${categorieId}`, obj, callBack, errBack)
}
//删除配置标签
export function delLable(categorieId, callBack, errBack) {
  return pubRequire(
    'delete',
    `${baseUrl}/${categorieId}`,
    '',
    callBack,
    errBack
  )
}
/* 校验标签分类名称 */
export function getLabelCategoryName(obj, callbBack, errBack) {
  return pubRequire('get', `${baseUrl}/verifications`, obj, callbBack, errBack)
}
/* 停用 */
export function disable(labelId, callbBack, errBack) {
  return pubRequire(
    'put',
    `/content/labels/${labelId}/disabled`,
    '',
    callbBack,
    errBack
  )
}
/* 启用 */
export function enable(labelId, callbBack, errBack) {
  return pubRequire(
    'put',
    `/content/labels/${labelId}/enabled`,
    '',
    callbBack,
    errBack
  )
}
// 根据分类ID查询标签集合
export function getLabels(categorieId, obj, callBack, errBack) {
  return pubRequire(
    'get',
    `${baseUrl}/${categorieId}/labels`,
    obj,
    callBack,
    errBack
  )
}
// 标签推荐-显性标签-根据分类ID查询标签集合
export function getShowTagLabels(categorieId, obj, callBack, errBack) {
  return pubRequire(
    'get',
    `${baseUrl}/${categorieId}/recommends`,
    obj,
    callBack,
    errBack
  )
}
// 根据分类ID查询标签集合
export function getLabelsGather(categorieId, obj, callBack, errBack) {
  return pubRequire(
    'get',
    `${baseUrl}/${categorieId}/content-labels`,
    obj,
    callBack,
    errBack
  )
}
